/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_numeric_literal.h

	$Header: /heroes4/script_numeric_literal.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_NUMERIC_LITERAL_H_INCLUDED )
#define SCRIPT_NUMERIC_LITERAL_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "abstract_script_expression.h"
#include "script_expression_type.h"

// --------------------------------------------------------------------------
// t_script_numeric_literal class
// --------------------------------------------------------------------------

class t_script_numeric_literal : public t_abstract_script_numeric_expression
{
public:
	// Constructor
	t_script_numeric_literal();

	// Member functions
	int					get_value() const;

	virtual bool		read( std::streambuf& stream, int version );
	virtual bool		read_from_map(
							std::streambuf &	stream,
							int					format_version );
	virtual bool		write( std::streambuf& stream ) const;

	virtual t_result	evaluate(t_expression_context_global const& context) const;

private:
	// Data members
	int	m_value;
};

// --------------------------------------------------------------------------
// t_script_numeric_literal inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_script_numeric_literal::t_script_numeric_literal()
	:	m_value( 0 )
{
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline int t_script_numeric_literal::get_value() const
{
	return m_value;
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_script_numeric_literal::t_result t_script_numeric_literal::evaluate(t_expression_context_global const& context) const
{
	return get_value();
}

SPECIALIZE_SCRIPT_NUMERIC_EXPRESSION( k_script_numeric_literal, t_script_numeric_literal );

#endif // !defined( SCRIPT_NUMERIC_LITERAL_H_INCLUDED )
